home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!Alun.Champion
- From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
- Newsgroups: comp.lang.c
- Subject: Re: Secure from Decompiling??
- Date: 17 Jan 1996 18:51:06 GMT
- Organization: Computer People Inc.
- Message-ID: <ALUN.CHAMPION.96Jan17135106@g7240065.bridge.bst.bls.com>
- References: <4djaq2$jd5@earth.superlink.net>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
- In-reply-to: rstewart@mars.superlink.net's message of Wed, 17 Jan 1996
- 17:14:17 GMT
-
- In article <4djaq2$jd5@earth.superlink.net> rstewart@mars.superlink.net (Bob Stewart) writes:
-
- : I have a compiled C program containing a string that I want no one to
- : be able to see, even with a decompiler.
-
- : Is there any thing to put in the code that can prevent it from being
- : decompiled, or make the decompiled code unintelligle??
-
- : Thanks for your help,
-
- A simple mechanism is to only initialise the string to an encrypted form
- and then decrypt at runtime.
-
- Example:
-
- #include <stdio.h>
-
- int
- main(void)
- {
- char a[] = "\xad\x80\x89\x89\x8a\xc5\x92\x8a\x97\x89\x81\xc4\xc4\xef";
-
- for (char* p = a; *p; p++)
- putchar(*p ^ 0xe5);
-
- return 0;
- }
-
- It just uses a simple XOR, this will not stop a determined individual
- but for casually lookers there will be nothing to see.
-
- Regards
-
- -A.
-
- --
- | A.Champion |
-